<template>
    <div class="tab">
        <span :class="defaultTab===index?'activeTab':''" v-for="(i,index) in tab" :key="index" @click="$emit('travelTab',index)">{{i}}</span>
    </div>
</template>
<script>
export default {
    data(){
        return{
             tab:['最近预定','已完成','喜欢']
        }
    },
    props:['defaultTab','travelTab']
}
</script>
<style scoped>
.activeTab{
     color: #58bfc0;
}
.tab{
    width: 100%;
    height: 40px;
    line-height: 40px;
    border-radius: 20px;
    background: #f5f5f5;
    font-size: 12px;
    color: #919191;
    padding: 0 15px;
    box-sizing: border-box;
    /* column-count: 3; */
}
.tab span{
    float:left;
    width: 33%;
    text-align: center;
    /* break-inside: avoid; */
  
}

</style>